#include "cx_utility.h"

void cx_slist_add_tail(cx_slist_t *node, cx_slist_t *head)
{
    while (head->next) {
        head = head->next;
    }

    cx_slist_add(node, head);
}

void cx_slist_del(cx_slist_t *node, cx_slist_t *head)
{
    while (head->next) {
        if (head->next == node) {
            head->next = node->next;
            break;
        }

        head = head->next;
    }
}

int cx_slist_entry_number(cx_slist_t *queue)
{
    int num;
    cx_slist_t *cur = queue;
    for (num=0; cur->next; cur=cur->next, num++)
        ;

    return num;
}


